/*
Date:20210427
key:无任何感想
 */
class Solution {
public:
void A(TreeNode* root, int &low, int &high, int&re)
{
    if(root->left!=nullptr)
    {
        A(root->left,low,high,re);
    }
    if(root->val>=low&&root->val<=high)
    {
        re+=root->val;
    }

        if(root->right!=nullptr)
    {
        A(root->right,low,high,re);
    }
}
    int rangeSumBST(TreeNode* root, int low, int high) 
    {
        int re=0;
        A(root, low, high, re);

        return re;
    }

};